<?php
namespace Plugin\Device\Schema;

use Plugin\Device\Model\RdDeviceBroadcastServer;
use Hyperf\Swagger\Annotation\Property;
use Hyperf\Swagger\Annotation\Schema;

/**
 * 广播服务器
 */
#[Schema(title: 'RdDeviceBroadcastServerSchema')]
class RdDeviceBroadcastServerSchema implements \JsonSerializable
{
    #[Property(property: 'id', title: 'id', type: 'bigint')]
    public string $id;

    #[Property(property: 'name', title: '名称', type: 'varchar')]
    public string $name;

    #[Property(property: 'link', title: '链接地址', type: 'varchar')]
    public string $link;

    #[Property(property: 'username', title: '用户名', type: 'varchar')]
    public string $username;

    #[Property(property: 'password', title: '密码', type: 'varchar')]
    public string $password;

    #[Property(property: 'auth', title: '认证', type: 'varchar')]
    public string $auth;

    #[Property(property: 'remarks', title: '备注', type: 'varchar')]
    public string $remarks;

    #[Property(property: 'created_at', title: 'created_at', type: 'timestamp')]
    public string $created_at;

    #[Property(property: 'updated_at', title: 'updated_at', type: 'timestamp')]
    public string $updated_at;

    #[Property(property: 'created_by', title: '创建者', type: 'bigint')]
    public string $created_by;

    #[Property(property: 'updated_by', title: '更新者', type: 'bigint')]
    public string $updated_by;




    public function __construct(RdDeviceBroadcastServer $model)
    {
       $this->id = $model->id;
       $this->name = $model->name;
       $this->link = $model->link;
       $this->username = $model->username;
       $this->password = $model->password;
       $this->auth = $model->auth;
       $this->remarks = $model->remarks;
       $this->created_at = $model->created_at;
       $this->updated_at = $model->updated_at;
       $this->created_by = $model->created_by;
       $this->updated_by = $model->updated_by;

    }

    public function jsonSerialize(): array
    {
        return ['id' => $this->id ,'name' => $this->name ,'link' => $this->link ,'username' => $this->username ,'password' => $this->password ,'auth' => $this->auth ,'remarks' => $this->remarks ,'created_at' => $this->created_at ,'updated_at' => $this->updated_at ,'created_by' => $this->created_by ,'updated_by' => $this->updated_by];
    }
}